/* GUI CONVERTED from rccup.i (converter v1.76) Fri May  3 13:21:01 2002 */
/* rccup.i - Release Management Customer Schedules                            */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.11.2.5 $                                                      */
/*V8:ConvertMode=Report                                                       */
/* REVISION: 7.4    LAST MODIFIED: 10/01/93     BY: WUG *H148*                */
/* REVISION: 7.4    LAST MODIFIED: 08/25/95     BY: bcm *G0TB*                */
/* REVISION: 7.4    LAST MODIFIED: 07/31/96     BY: *G29C* Ajit Deodhar       */
/* REVISION: 8.5    LAST MODIFIED: 09/26/97     BY: *J21M* Suresh Nayak       */
/* REVISION: 8.5    LAST MODIFIED: 11/11/97     BY: *J25V* Mandar Kapshikar   */
/* REVISION: 8.5    LAST MODIFIED: 12/01/97     BY: *J275* Suresh Nayak       */
/* REVISION: 8.6E   LAST MODIFIED: 02/23/98     BY: *L007* A. Rahane          */
/* REVISION: 8.6E   LAST MODIFIED: 05/20/98     BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E   LAST MODIFIED: 09/14/98     BY: *J2V3* Steve Nugent       */
/* REVISION: 8.6E   LAST MODIFIED: 10/12/98     BY: *L0BY* Alfred Tan         */
/* REVISION: 9.1    LAST MODIFIED: 11/03/99     BY: *N05R* B. Gates           */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00     BY: *N0KP* Mark Brown         */
/* REVISION: 9.1    LAST MODIFIED: 09/05/00     BY: *N0R9* Mudit Mehta        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.11.2.4     BY: Jean Miller    DATE: 03/22/01 ECO: *P008*       */
/* $Revision: 1.11.2.5 $    BY: Katie Hilbert  DATE: 04/15/02 ECO: *P03J*        */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* MASS CUM RESET INCLUDE */

/*
 * {1} = "break by ..."
*/


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{rcrpvar.i "shared"}
define shared variable update_yn         like mfc_logical.
define shared variable cum_ship_start_dt as date.
define shared variable remarks           as character format "x(24)".
define shared variable l_int_time        as integer no-undo.
define shared variable l_summary         as logical format "Summary/Detail"
                                         label "Report Summary/Detail" no-undo.
define shared variable sortoption        as integer format "9"
                                         label "Sort Option"  initial 1.
define shared variable l_dt_ship_eff     as logical format "Shipment/Effective"
                                         label "Shipment/Effective Date" no-undo.
define shared variable l_cum_adj         like mfc_logical initial "yes"
                                         label "Include Manual Cum Adjustment" no-undo .

define variable sod_recid     as recid.
define variable undo_upu1     as logical.
define variable l_new_cum_qty like sod_cum_qty[1] no-undo.

define buffer   soddet        for sod_det.

define new shared frame summary1.
define new shared frame summary2.

{rccupfrm.i}

FORM /*GUI*/  header
   skip(1)
with STREAM-IO /*GUI*/  frame skipline page-top width 132.
view frame skipline.

for each scx_ref no-lock
   where scx_type = 1
     and scx_shipfrom >= shipfrom_from and scx_shipfrom <= shipfrom_to
     and scx_shipto >= shipto_from and scx_shipto <= shipto_to
     and scx_part >= part_from and scx_part <= part_to
     and scx_po >= po_from and scx_po <= po_to
     and scx_custref >= custref_from and scx_custref <= custref_to
     and scx_modelyr >= modelyr_from and scx_modelyr <= modelyr_to
     and scx_order >= order_from and scx_order <= order_to,
  each sod_det no-lock
 where sod_nbr = scx_order and sod_line = scx_line
   and sod_dock >= dock_from and sod_dock <= dock_to,
  each so_mstr no-lock
 where so_nbr = sod_nbr
   and so_cust >= cust_from and so_cust <= cust_to
      {1}:

   assign
      l_new_cum_qty = 0
      sod_recid = recid(sod_det).

   /* Cum Ship Reset Report Print */
   {gprun.i ""rccupc.p""
      "(input  sod_recid,
        input  cum_ship_start_dt,
        input  l_int_time,
        input  l_summary,
        input  l_dt_ship_eff,
        input  l_cum_adj,
        input  sortoption,
        output l_new_cum_qty)"}

   if update_yn then do:
      assign
         sod_recid = recid(sod_det)
         undo_upu1 = true.

      {gprun.i ""rccupu1.p""
         "(input  sod_recid,
           input  global_db,
           input  remarks,
           input  so_cust,
           input  cum_ship_start_dt,
           input  l_int_time,
           input  l_new_cum_qty,
           input-output undo_upu1)"}

      if undo_upu1 then next.

      do for soddet:

         find soddet where recid(soddet) = recid(sod_det)
         exclusive-lock.

         assign
            sod_cum_qty[1]  = l_new_cum_qty
            sod_cum_date[1] = cum_ship_start_dt
            sod_cum_time[1] = l_int_time.

      end.

      {gprun.i ""rcmrw.p""
         "(input sod_nbr, input sod_line, input no)"}

   end. /* if update_yn */

   
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


end.
